Repository navigation
SD command queueing take 2 - #6076
Merged
Merged
Conversation
The eMMC spec says that in certain circumstances the controller can't respond to a halt request - in practice, this occurs if a CMD timeout happens (card went away/crashed). Clear the halt request by writing 0 to CQHCI_CTL. Also fix a logic error testing for halt in cqhci_request. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Certain status bits in these registers may need polling outside of SD-specific code. Export in sd_ops.h Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
pelwell
reviewed
Mar 27, 2024
| /* Poll the register - cards may have a lazy init/deinit sequence. */ | ||
| timeout = ktime_add_ms(ktime_get(), 10); | ||
| while (1) { | ||
| timedout = ktime_after(ktime_get(), timeout); |
Contributor
There was a problem hiding this comment.
Do you have to check for timeout here? It's counterintuitive, and will result in one extra read after the timeout has elapsed. If intentional, it warrants a comment.
Contributor
Author
There was a problem hiding this comment.
The timeout length is arbitrary, but the boolean can be removed - no real need to store it separately.
Contributor
There was a problem hiding this comment.
Good - it will remove the feeling that something clever might be happening.
Don't attempt to turn on CQ if the other mandatory features are not indicated as supported by the card. Also make sure that the register write actually stuck, as some cards claim support but never report back that the queue engine is enabled. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
Also report the card's supported queue depth in the message log. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
The spec allows for up to two 512-byte pages to be allocated for the Extension Register General Info block, so allocate accordingly. Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
popcornmix
added a commit
to raspberrypi/firmware
that referenced
this pull request
Mar 27, 2024
See: raspberrypi/linux#6076 kernel: i2c: designware: Add support for bus clear feature See: raspberrypi/linux#6071 kernel: RTC PCF2131 support See: raspberrypi/linux#6070 kernel: allo-boss-dac mute output when changing parameters See: raspberrypi/linux#6074 kernel: dts: bcm2712: Add blpubkey nvram node See: raspberrypi/linux#6073 kernel: drivers: sdhci-brcmstb: work around mystery CQE CMD_IDLE_TIMER trampling See: raspberrypi/linux#6060 kernel: drm/vc4: Enable bg_fill if there are no planes enabled See: raspberrypi/linux#6066 kernel: ARM: dts: bcm2712: Add the missing L1/L2/L3 cache information See: raspberrypi/linux#6061
popcornmix
added a commit
to raspberrypi/rpi-firmware
that referenced
this pull request
Mar 27, 2024
See: raspberrypi/linux#6076 kernel: i2c: designware: Add support for bus clear feature See: raspberrypi/linux#6071 kernel: RTC PCF2131 support See: raspberrypi/linux#6070 kernel: allo-boss-dac mute output when changing parameters See: raspberrypi/linux#6074 kernel: dts: bcm2712: Add blpubkey nvram node See: raspberrypi/linux#6073 kernel: drivers: sdhci-brcmstb: work around mystery CQE CMD_IDLE_TIMER trampling See: raspberrypi/linux#6060 kernel: drm/vc4: Enable bg_fill if there are no planes enabled See: raspberrypi/linux#6066 kernel: ARM: dts: bcm2712: Add the missing L1/L2/L3 cache information See: raspberrypi/linux#6061
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This series adds more robustness when deciding whether to use CQE, adds some user-accessible debug and fixes up some omissions in error handling.